﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.SessionState;
using System.Configuration;

using System.Text.RegularExpressions;

namespace WebSite
{
    public partial class _Default : System.Web.UI.Page, IRequiresSessionState
    {
        // Methods
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Response.Redirect("cn/index.aspx");
        }


        public static bool IsMobile { get { var context = HttpContext.Current; if (context != null) { var request = context.Request; if (request.Browser.IsMobileDevice) { return true; } if (!string.IsNullOrEmpty(request.UserAgent) && RegexMobile.IsMatch(request.UserAgent)) { return true; } } return false; } }

        /// <summary>      
        ///  The regex mobile.        
        /// </summary>     
        private static readonly Regex RegexMobile =            new Regex(    ConfigurationManager.AppSettings.Get("BlogEngine.MobileDevices"),                RegexOptions.IgnoreCase | RegexOptions.Compiled);



        //// Properties
        //protected global_asax ApplicationInstance
        //{
        //    get
        //    {
        //        return (global_asax)this.Context.ApplicationInstance;
        //    }
        //}

        //protected DefaultProfile Profile
        //{
        //    get
        //    {
        //        return (DefaultProfile)this.Context.Profile;
        //    }
        //}

    }
}